package com.totem.base.enums;

import lombok.Getter;

@Getter
public enum ResourceTypeEnum {
    MENU("MENU"),
    PAGE("PAGE"),
    BUTTON("BUTTON"),
    FIELD("FIELD");

    private final String code;

    ResourceTypeEnum(String code){
        this.code = code;
    }

    public static ResourceTypeEnum byCode(String code) {
        for (ResourceTypeEnum e: ResourceTypeEnum.values()) {
            if (e.code.equalsIgnoreCase(code)) {
                return e;
            }
        }
        return null;
    }
}
